package com.itzhigui.utils;

/**
 * 统一固定的所有的状态
 *
 * @author java1412
 * @since 2023-11-09 14:20:24
 */
public enum ResponseEnum {
    // 用户有关的状态10xx开头
    USER_ALL_SUCCESS(1001, "查询所有用户成功"),
    USER_ID_SUCCESS(1002, "根据id查询用户成功"),
    USER_ADD_SUCCESS(1003, "添加用户信息成功"),
    USER_ADD_FAILURE(1004, "添加用户信息失败"),
    USER_API_LOGIN_1(1005, "用户名不存在"),
    USER_API_LOGIN_2(1006, "用户名存在，密码不正确"),
    USER_API_LOGIN_3(1007, "用户名和密码匹配，角色不正确"),
    USER_API_LOGIN_SUCCESS(1008, "前台登录成功"),
    USER_API_GET_CURRENT_INFO(1009, "获取当前的用户信息成功"),
    USER_API_LOGOUT_SUCCESS(1010, "用户注销成功"),
    USER_ADMIN_LOGIN_ERROR_ROLE(1011, "用户不是管理员"),
    USER_ADMIN_LOGIN_SUCCESS(1012, "管理员登录成功"),
    USER_FIND_SUCCESS(1013, "查询用户信息成功"),
    // 定义短信有关的状态20xx开头
    SMS_VERIFY_4_CODE_SUCCESS(2001, "发送四位验证码成功"),
    SMS_VERIFY_CODE_NOT_IN_REDIS(2002, "验证码不存在"),
    SMS_VERIFY_CODE_NOT_MATCH(2003, "验证码不匹配"),
    // 购物车的状态30xx开头
    CART_FIND_COUNT(3001, "获取购物车数量成功"),
    CART_FIND_COUNT_FAILURE(3002, "用户未登录，不能获取购物车"),
    CART_FIND_CART_INFO(3003, "获取购物车数据成功"),
    CART_UPDATE_CART_SUCCESS(3004, "更新购物车状态成功"),
    CART_UPDATE_CART_FAILURE(3005, "更新购物车状态失败"),
    CART_DELETE_CART_SUCCESS(3006, "删除购物车状态成功"),
    CART_DELETE_CART_FAILURE(3007, "删除购物车状态失败"),
    // 支付,40xx
    PAY_INFO_FINDALL_SUCCESS(4001, "查询所有支付信息成功"),
    ;

    private Integer code;
    private String msg;

    ResponseEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
